spa.util = (function($){
    var makeError,setConfigMap

    makeError = function(name_text,msg_text,data){
        var error = new Error()
        error.name = name_text
        error.message = msg_text
        error.data = data
        if (data){
            error.data = data
        }
    }

    setConfigMap = function(arg_map){
        var
            input_map = arg_map.input_map,
            settable_map = arg_map.settable_map,
            config_map = arg_map.config_map,
            key_name,error

        for(key_name in input_map){
            if(input_map.hasOwnProperty(key_name)){
                if (settable_map.hasOwnProperty(key_name)){
                    config_map[key_name] = input_map[key_name]
                } else {
                    error = makeError('不正确的输入','键名为[' + key_name + ']的属性不允许设置!')
                    throw error
                }
            }
        }
    }

    return {
        makeError : makeError,
        setConfigMap : setConfigMap
    }
}(jQuery))